import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import vitePluginImp from 'vite-plugin-imp'
import windiCSS from 'vite-plugin-windicss';
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(), vitePluginImp({
    optimize: true,
    libList: [
      {
        libName: 'antd',
        libDirectory: 'es',
        style: (name) => `antd/es/${name}/style`
      }
    ],
  }), windiCSS()],
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true
      }
    }
  },
  resolve: {
    alias: [
      { find: /^~/, replacement: '', }
    ]
  }

})
